﻿using Learun.Util;
using SqlSugar;
using System;
using System.Collections.Generic;
namespace Learun.Application.TwoDevelopment.ZZDT_EC

{
    /// <summary>
    /// 版 本 PIT-ADMS V7.0.3 敏捷开发框架
    /// Copyright (c) 2013-2018 Hexagon PPM
    /// 创 建：超级管理员
    /// 日 期：2022-06-21 15:32
    /// 描 述：接线模块 - panel柜子
    /// </summary>
    [SugarTable(TableName = "ec_Cable_Set")]
    public class ec_CableSetEntity
    {
        #region 实体成员
        /// <summary>
        /// ID
        /// </summary>
        /// <returns></returns>
        public string CableID { get; set; } = "";
        /// <summary>
        /// CableSetID
        /// </summary>
        /// <returns></returns>
        [SugarColumn(IsPrimaryKey = true)]
        public string CableSetID { get; set; }
        /// <summary>
        /// CableSetSeq
        /// </summary>
        /// <returns></returns>
        public int? CableSetSeq { get; set; }
        /// <summary>
        /// CableSetName
        /// </summary>
        /// <returns></returns>
        public string CableSetName { get; set; } = "";
        /// <summary>
        /// 伪分组名称。通道没和一个信号真正关联时，可以人为先指定一些信息。
        /// </summary>
        /// <returns></returns>
        //public string FakeGroupName { get; set; } = "";
        /// <summary>
        /// 伪分组描述
        /// </summary>
        /// <returns></returns>
        //public string FakeGroupDesc { get; set; } = "";
        /// <summary>
        /// 伪分组描述（英文）
        /// </summary>
        /// <returns></returns>
        //public string FakeGroupDescEN { get; set; } = "";
        /// <summary>
        /// 伪信号类型
        /// </summary>
        /// <returns></returns>
        // public string FakeSignalType { get; set; } = "";
        /// <summary>
        /// 创建人
        /// </summary>
        /// <returns></returns>
        public string CreateUserID { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        /// <returns></returns>
        public DateTime? CreateTime { get; set; }
        /// <summary>
        /// 更新人
        /// </summary>
        /// <returns></returns>
        public string UpdateUserID { get; set; }
        /// <summary>
        /// 更新时间
        /// </summary>
        /// <returns></returns>
        public DateTime? UpdateTime { get; set; }
        #endregion

        #region 扩展操作
        /// <summary>
        /// 新增调用
        /// </summary>
        public void Create()
        {
            this.CableSetID = Guid.NewGuid().ToString();
            this.CreateTime = Time.MySqlTime;
            UserInfo userInfo = LoginUserInfo.Get();
            this.CreateUserID = userInfo.userId;


        }
        /// <summary>
        /// 编辑调用
        /// </summary>
        /// <param name="keyValue"></param>
        public void Modify(string keyValue)
        {
            this.CableSetID = keyValue;
            this.UpdateTime = Time.MySqlTime;
            UserInfo userInfo = LoginUserInfo.Get();
            this.UpdateUserID = userInfo.userId;
        }
        #endregion

        #region 扩展字段
        /// <summary>
        /// 
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public List<ec_CableSetWireEntity> Wires { set; get; }

        /// <summary>
        /// 是否被连接
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public bool? IsConned { set; get; }

        /// <summary>
        /// 当前这个set的连接情况
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public string ConnectionInfo { set; get; }
        /// <summary>
        /// 删除标记
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public bool DeleteFlg { set; get; } = false;
        #endregion

        public ec_CableSetEntity()
        {
            IsConned = null;
        }
    }
}

